<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::get('/hello',function(){
	return "hello world";
});

Route::get('/hello/{id}',function($id){
	return 'user'.$id;
});

Route::get('/hell',function(){
	return url('aa');
});

Route::get('/demo/{id?}',function($id){
	return "username".$id;
});



//通过URL 访问控制和方法
Route::get('/test',"testController@index");
Route::get('/test/test',"testController@test");
Route::get('/test/get',"testController@getList");

Route::resource('test','testController');
Route::get('/test/delete/{id}',"testController@delete");//删除
Route::post('/test/update',"testController@update");//更新

//图片上传页面路由
Route::get("/upload",function(){
	return view("upload");
});

//post提交路由
Route::post('doupload',"TestController@doUpload");

//响应信息
Route::get("/response","TestController@response");
Route::get("/shancun","TestController@shancun");


//后台模板
/*Route::get("/admin","Admin\IndexController@index");
Route::get("/admin/login","Admin\LoginController@login");
Route::post("/admin/dologin","Admin\LoginController@doLogin");*/
require_once app_path('Http/Route').'/admin.php';


//微型博客
Route::get('/art/display',"ArticleController@display");//预览
Route::get('/art/getdata',"ArticleController@getData");//获取数据

Route::resource("art",'ArticleController');


//登录注册路由
// 认证路由...
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');
// 注册路由...
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');

//隐士控制器 登陆注册验证码
Route::controller('check','ArticleController');


//前台路由
Route::get('/','Home\IndexController@index');

Route::resource('/cat','Home\CatController');

//照片上传
Route::resource('/image','Home\ImageController');

//商品详情
Route::resource('goods','Home\GoodsController');

//商品购物车
Route::resource('cart','Home\CartController');

//添加商品到购物车
Route::get('addCart/{gid}/{num?}','Home\CartController@addCart');

//移除购物车
Route::get('remCart/{rowid}','Home\CartController@removeCart');

//清空购物车
Route::get('delcart','Home\CartController@dellCart');



